var Lr=Object.defineProperty;var Dr=(w,P,N)=>P in w?Lr(w,P,{enumerable:!0,configurable:!0,writable:!0,value:N}):w[P]=N;var m=(w,P,N)=>(Dr(w,typeof P!="symbol"?P+"":P,N),N);(function(w,P){typeof exports=="object"&&typeof module<"u"?P(exports):typeof define=="function"&&define.amd?define(["exports"],P):(w=typeof globalThis<"u"?globalThis:w||self,P(w.OrderProtection={}))})(this,function(w){var Pe,ke;"use strict";class P{constructor(){m(this,"events",{})}off(e,t){this.events[e]&&(this.events[e]=this.events[e].filter(o=>o!==t))}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}emit(e,...t){this.events[e]&&this.events[e].forEach(o=>o(...t))}}function N(r={}){const e=(t,o,n={})=>{const i={...r.headers,"x-source":"orderprotection","Content-Type":"application/json"},a=t==="GET"&&n.params?new URLSearchParams(n.params).toString():null,p=`${r.baseURL||""}${o}${a?`?${a}`:""}`,l={method:t,headers:i,body:n?JSON.stringify(n):void 0};return t==="GET"&&delete l.body,fetch(p,l).then(async h=>{if(!h.ok)throw new Error(`Fetch error: ${h.statusText}`);return{data:await h.json()}})};return{get:(t,o)=>e("GET",t,o),post:(t,o)=>e("POST",t,o),put:(t,o)=>e("PUT",t,o),delete:t=>e("DELETE",t)}}const E={__debug:!1,set debug(r){E.__debug=r},get debug(){return E.__debug},log:(...r)=>{E.debug&&console.log("[INFO]",...r)},info:(...r)=>{E.debug&&console.log("[INFO]",...r)},warn:(...r)=>{E.debug&&console.log("[WARN]",...r)},error:(...r)=>{E.debug&&console.error("[ERROR]",...r)}},Ce={change:"change"};let Ee=(Pe=class extends P{constructor(){super();m(this,"cart",{items:[],requires_shipping:!1,items_subtotal_price:0,currency:"USD"});m(this,"api");this.api=N()}get item_count(){return this.cart.items.length}set items(t){this.cart.items=t}get items(){return this.cart.items}get requires_shipping(){return this.cart.requires_shipping}async load(){const t=await this.api.get("/cart.js");this.cart=t.data}async add({variantId:t}){return E.info("Adding to cart Shopify"),this.api.post("/cart/update.js",{updates:{[t]:1}})}async remove(){const t=this.items.filter(o=>o.vendor==="Order Protection").reduce((o,n)=>(o[n.variant_id]=0,o),{});return E.info("Removing from cart Shopify"),this.api.post("/cart/update.js",{updates:t})}get hasPhysicalGoods(){return this.cart.requires_shipping}emitChange(){this.emit(Ce.change,this)}get currency(){return this.cart.currency}get subtotal(){return this.cart.items_subtotal_price}get hasOrderProtection(){return this.items.find(t=>t.vendor.includes("Order Protection"))}},m(Pe,"Listeners",Ce),Pe);var H,d,Oe,A,Se,Te,se,R={},Le=[],gt=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,V=Array.isArray;function T(r,e){for(var t in e)r[t]=e[t];return r}function De(r){var e=r.parentNode;e&&e.removeChild(r)}function L(r,e,t){var o,n,i,a={};for(i in e)i=="key"?o=e[i]:i=="ref"?n=e[i]:a[i]=e[i];if(arguments.length>2&&(a.children=arguments.length>3?H.call(arguments,2):t),typeof r=="function"&&r.defaultProps!=null)for(i in r.defaultProps)a[i]===void 0&&(a[i]=r.defaultProps[i]);return j(r,a,o,n,null)}function j(r,e,t,o,n){var i={type:r,props:e,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++Oe,__i:-1,__u:0};return n==null&&d.vnode!=null&&d.vnode(i),i}function O(r){return r.children}function S(r,e){this.props=r,this.context=e}function M(r,e){if(e==null)return r.__?M(r.__,r.__i+1):null;for(var t;ee&&A.sort(se));W.__r=0}function Re(r,e,t,o,n,i,a,c,p,l,h){var _,g,u,b,I,f=o&&o.__k||Le,y=e.length;for(t.__d=p,bt(t,e,f),p=t.__d,_=0;_0?j(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=r,n.__b=r.__b+1,c=yt(n,t,a=o+_,h),n.__i=c,i=null,c!==-1&&(h--,(i=t[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&_--,typeof n.type!="function"&&(n.__u|=65536)):c!==a&&(c===a+1?_++:c>a?h>p-a?_+=c-a:_--:_=c(p!=null&&!(131072&p.__u)?1:0))for(;a>=0||c=0){if((p=e[a])&&!(131072&p.__u)&&n==p.key&&i===p.type)return a;a--}if(c=t.__.length&&t.__.push({__V:J}),t.__[r]}function de(r){return Y=1,wt(Ke,r)}function wt(r,e,t){var o=pe($++,2);if(o.t=r,!o.__c&&(o.__=[t?t(e):Ke(void 0,e),function(c){var p=o.__N?o.__N[0]:o.__[0],l=o.t(p,c);p!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=v,!v.u)){var n=function(c,p,l){if(!o.__c.__H)return!0;var h=o.__c.__H.__.filter(function(g){return g.__c});if(h.every(function(g){return!g.__N}))return!i||i.call(this,c,p,l);var _=!1;return h.forEach(function(g){if(g.__N){var u=g.__[0];g.__=g.__N,g.__N=void 0,u!==g.__[0]&&(_=!0)}}),!(!_&&o.__c.props===c)&&(!i||i.call(this,c,p,l))};v.u=!0;var i=v.shouldComponentUpdate,a=v.componentWillUpdate;v.componentWillUpdate=function(c,p,l){if(this.__e){var h=i;i=void 0,n(c,p,l),i=h}a&&a.call(this,c,p,l)},v.shouldComponentUpdate=n}return o.__N||o.__}function ue(r,e){var t=pe($++,3);!d.__s&&Je(t.__H,e)&&(t.__=r,t.i=e,v.__H.__h.push(t))}function It(r){return Y=5,Pt(function(){return{current:r}},[])}function Pt(r,e){var t=pe($++,7);return Je(t.__H,e)?(t.__V=r(),t.i=e,t.__h=r,t.__V):t.__}function kt(){for(var r;r=Ve.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(K),r.__H.__h.forEach(he),r.__H.__h=[]}catch(e){r.__H.__h=[],d.__e(e,r.__v)}}d.__b=function(r){v=null,je&&je(r)},d.__r=function(r){We&&We(r),$=0;var e=(v=r.__c).__H;e&&(le===v?(e.__h=[],v.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=J,t.__N=t.i=void 0})):(e.__h.forEach(K),e.__h.forEach(he),e.__h=[],$=0)),le=v},d.diffed=function(r){qe&&qe(r);var e=r.__c;e&&e.__H&&(e.__H.__h.length&&(Ve.push(e)!==1&&He===d.requestAnimationFrame||((He=d.requestAnimationFrame)||Nt)(kt)),e.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==J&&(t.__=t.__V),t.i=void 0,t.__V=J})),le=v=null},d.__c=function(r,e){e.some(function(t){try{t.__h.forEach(K),t.__h=t.__h.filter(function(o){return!o.__||he(o)})}catch(o){e.some(function(n){n.__h&&(n.__h=[])}),e=[],d.__e(o,t.__v)}}),Ge&&Ge(r,e)},d.unmount=function(r){Xe&&Xe(r);var e,t=r.__c;t&&t.__H&&(t.__H.__.forEach(function(o){try{K(o)}catch(n){e=n}}),t.__H=void 0,e&&d.__e(e,t.__v))};var Ye=typeof requestAnimationFrame=="function";function Nt(r){var e,t=function(){clearTimeout(o),Ye&&cancelAnimationFrame(e),setTimeout(r)},o=setTimeout(t,100);Ye&&(e=requestAnimationFrame(t))}function K(r){var e=v,t=r.__c;typeof t=="function"&&(r.__c=void 0,t()),v=e}function he(r){var e=v;r.__c=r.__(),v=e}function Je(r,e){return!r||r.length!==e.length||e.some(function(t,o){return t!==r[o]})}function Ke(r,e){return typeof e=="function"?e(r):e}const Z={MOBILE:320,TABLET:640};function Ct(r){return Object.entries(r).reduce((t,[o,n])=>(n&&t.push(o),t),[]).join(" ")}const Q=(r,e,t="order-protection")=>{var n;const o=((n=document.getElementById(t))==null?void 0:n.getBoundingClientRect())||{width:0};return Ct({[r]:!0,[e.default]:o.width=Z.MOBILE&&o.width=Z.TABLET})};var Et=0;function s(r,e,t,o,n,i){var a,c,p={};for(c in e)c=="ref"?a=e[c]:p[c]=e[c];var l={type:r,props:p,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--Et,__i:-1,__u:0,__source:n,__self:i};if(typeof r=="function"&&(a=r.defaultProps))for(c in a)p[c]===void 0&&(p[c]=a[c]);return d.vnode&&d.vnode(l),l}function Ot({currency:r="USD",children:e}){const o=((isNaN(Number(e))?0:Number(e))/100).toFixed(2),n=Number(o).toLocaleString("en-US",{style:"currency",currency:r});return s("div",{className:"__op-text-[12px] __op-leading-[20px] __op-font-medium __op-mr-[4px] mobilelg:__op-mr-[6px] tablet:__op-mr-[8px] __op-mt-[0.5px]",children:[s("label",{id:"op-price",className:"__op-text-black __op-mb-0",for:"op-toggle",children:n}),s("label",{className:"__op-sr-only",for:"op-toggle",children:["Protection fee is $",o]})]})}const Ar="";function U(...r){return r.filter(Boolean).join(" ")}function St(){const r=[{title:"Add shipping protection to your order.",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_1.png"},{title:"Have a shipping issue? Let us know.",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_2.png",checkList:["Theft","Lost packages","Damaged items","Wrong items","Missing items","Returned to sender"]},{title:"Get a reshipment or refund within the hour.*",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_3.png"}],e=U("op-banner","__op-flex __op-items-center __op-justify-start __op-mb-[16px] __op-text-[12px] __op-leading-[16px]",'before:__op-border-neutral-300 before:__op-content-[""] before:__op-border-l-[1px] before:__op-absolute');return s("div",{className:"__op-relative",children:[s("div",{className:"__op-absolute __op-inset-y-0 __op-bg-neutral-300 __op-w-[1px] md:__op-left-[26px] __op-left-[22px]"}),r.map((t,o)=>s("div",{className:e,children:[s("div",{className:" __op-bg-white __op-z-[2]",children:s("img",{src:t.image,alt:"Stock Image",className:"__op-h-[44px] __op-w-[44px] tablet:__op-h-[52px] tablet:__op-w-[52px] __op-rounded-full __op-border-[2px] __op-box-border __op-border-white __op-border-solid __op-shadow-op __op-mr-[16px]"})}),s("div",{className:"op-list-info",children:[s("p",{className:"__op-text-[14px] tablet:__op-text-[15px] __op-leading-[24px] __op-font-semibold __op-tracking-[-0.005em] __op-text-[#1D2433] __op-my-0",style:{fontFamily:"'Inter', sans-serif"},children:t.title}),s("div",{className:"__op-leading-[24px]",style:{fontFamily:"'Inter', sans-serif"},children:t.checkList&&s("ul",{className:"__op-list __op-grid __op-grid-cols-2 __op-pl-0 __op-mt-[8px] __op-mb-0",children:t.checkList.map((n,i)=>s("li",{children:n},`${n}${i}`))})})]})]},o))]})}function Tt(){return s("div",{className:"__op-px-[20px] tablet:__op-px-[32px] __op-py-[20px] __op-bg-[#f0f6f3] __op-rounded-[8px] __op-mx-[4px] tablet:__op-mx-[-16px] __op-mb-[16px]",children:s("div",{className:"tablet:__op-flex __op-flex-col tablet:__op-flex-row __op-items-start tablet:__op-items-center __op-justify-between __op-gap-[32px]",children:[s("div",{children:[s("h5",{className:"__op-text-success-900 __op-font-semibold __op-text-[16px] __op-leading-[24px] __op-tracking-[.01] __op-mt-0 __op-mb-[3px]",children:"Your order will be carbon neutral."}),s("p",{className:"__op-text-[12px] __op-leading-[16px] __op-mt-0 __op-mb-[20px] tablet:__op-mb-0 __op-tracking-[.005] __op-text-neutral-500",children:"We will offset the carbon footprint of shipping for your order."})]}),s("img",{className:"__op-h-[15px] __op-font-normal",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/ecocart.svg",alt:"Ecocart Logo"})]})})}function Lt({customClaimUrl:r}){const e=new Date().getUTCFullYear(),t=[{text:"Terms",link:"https://orderprotection.com/terms"},{text:"Privacy Policy",link:"https://orderprotection.com/privacy-policy"},{text:"File a Claim",link:r||"https://claims.orderprotection.com"}];return s("div",{className:"__op-text-[10px] __op-leading-[16px] __op-font-normal __op-text-neutral-500",style:{fontFamily:"'Inter', sans-serif"},children:[s("p",{className:"__op-mb-[6px] __op-mt-0",children:"* Approved claims only, 97% approval rate."}),s("p",{className:"__op-flex-wrap tablet:__op-flex __op-items-center __op-whitespace-pre-wrap __op-my-0",children:[e," © OrderProtection.com",t.map(({link:o,text:n},i)=>s("a",{href:o,target:"_blank",className:"__op-text-primary-800 __op-font-medium __op-no-underline hover:__op-underline __op-ml-[12px]",children:n},i))]})]})}const Mr="";function Dt({className:r,onClose:e,ecocart:t,customClaimUrl:o,modalRef:n}){return s("div",{className:U(r,"__op-bg-white"),role:"dialog","aria-modal":"true","aria-labelledby":"information-modal-title",style:{background:`radial-gradient( 70.61% 96.11% at 36.67% -1.11%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100% ) #ffffff; `,backgroundRepeat:"no-repeat",backgroundPosition:"top right",backgroundImage:"url(https://op-media-asset.s3.us-west-1.amazonaws.com/assets/bg-svg.svg)"},tabIndex:-1,ref:n,children:[s("h1",{className:"__op-sr-only",id:"information-modal-title",children:"Order Protection Information Modal"}),s("div",{className:"__op-flex __op-justify-between __op-items-center __op-mb-[24px]",children:[s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/order-protection-logo.svg",className:"__op-h-[18px] tablet:__op-h-[20px]",alt:"Order Protection Logo"}),s("button",{onClick:e,class:"__op-border-none __op-bg-transparent __op-outline-none __op-cursor-pointer",children:[s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/close-icon.svg",alt:"Close Info Modal",tabIndex:0,role:"button"}),s("span",{className:"__op-sr-only",children:"Close Info Modal"})]})]}),s("div",{className:"__op-mb-[20px]",children:[s("div",{className:"__op-text-primary-800 __op-text-[12px] __op-leading-[24px] __op-tracking-[-0.005em] __op-font-semibold",style:{fontFamily:"'Inter', sans-serif"},children:"Shipping Issues are over"}),s("h2",{className:"__op-text-[36px] __op-leading-[36px] __op-tracking-[-0.03em] __op-font-semibold __op-normal-case __op-mt-0 tablet:__op-leading-[40px] __op-mb-[20px] __op-text-black",style:{fontFamily:"'Faktum', sans-serif"},children:"Get shipping protection & 24/7 support."}),s("hr",{className:"__op-bg-neutral-300",style:{border:"none",height:"1px",backgroundColor:"#E1E6EF",width:"auto",marginTop:"20px"}})]}),s("div",{className:"__op-relative",children:s(St,{})}),t&&s(Tt,{}),s("div",{style:{marginTop:t?"0px":"32px"},children:s(Lt,{customClaimUrl:o})})]})}function At({onClose:r,ecocart:e,customClaimUrl:t}){const o=It(null);return ue(()=>{const n=o.current;n&&(n.focus(),n.addEventListener("keydown",i=>{i.key==="Escape"&&r()}))},[]),s(O,{children:[s("div",{className:"__op-fixed __op-inset-0 tablet:__op-flex __op-items-start __op-justify-center __op-z-[1] overlay __op-hidden",onClick:()=>r()}),s(Dt,{modalRef:o,onClose:r,className:"md:__op-h-max min-w-520 __op-absolute __op-inset-0 tablet:__op-absolute tablet:__op-h-auto __op-bg-white __op-max-w-full tablet:__op-rounded-[8px] tablet:__op-max-w-[520px] tablet:__op-box-border__op-p-[20px] __op-pt-[32px] __op-pb-[40px] tablet:__op-p-[40px] __op-z-50 __op-m-auto",ecocart:e,customClaimUrl:t})]})}const Rr="";function Mt({checked:r,onChange:e}){function t(o){e(o.target.checked)}return s("label",{className:"__op-cursor-pointer __op-mb-0 __op-leading-[20px]",for:"op-toggle",children:[s("input",{id:"op-toggle",type:"checkbox",className:"__op-checkbox",checked:r,onClick:t}),s("span",{className:"__op-checkbox-switch",tabIndex:0,role:"switch","aria-checked":r,onKeyDown:o=>{var n;(o.key==="Enter"||o.key===" ")&&((n=document.getElementById("op-toggle"))==null||n.click())}})]})}function Rt(r,e){for(var t in e)r[t]=e[t];return r}function me(r,e){for(var t in r)if(t!=="__source"&&!(t in e))return!0;for(var o in e)if(o!=="__source"&&r[o]!==e[o])return!0;return!1}function Ze(r){this.props=r}function $t(r,e){function t(n){var i=this.props.ref,a=i==n.ref;return!a&&i&&(i.call?i(null):i.current=null),e?!e(this.props,n)||!a:me(this.props,n)}function o(n){return this.shouldComponentUpdate=t,L(r,n)}return o.displayName="Memo("+(r.displayName||r.name)+")",o.prototype.isReactComponent=!0,o.__f=!0,o}(Ze.prototype=new S).isPureReactComponent=!0,Ze.prototype.shouldComponentUpdate=function(r,e){return me(this.props,r)||me(this.state,e)};var Qe=d.__b;d.__b=function(r){r.type&&r.type.__f&&r.ref&&(r.props.ref=r.ref,r.ref=null),Qe&&Qe(r)};var Ut=d.__e;d.__e=function(r,e,t,o){if(r.then){for(var n,i=e;i=i.__;)if((n=i.__c)&&n.__c)return e.__e==null&&(e.__e=t.__e,e.__k=t.__k),n.__c(r,e)}Ut(r,e,t,o)};var et=d.unmount;function tt(r,e,t){return r&&(r.__c&&r.__c.__H&&(r.__c.__H.__.forEach(function(o){typeof o.__c=="function"&&o.__c()}),r.__c.__H=null),(r=Rt({},r)).__c!=null&&(r.__c.__P===t&&(r.__c.__P=e),r.__c=null),r.__k=r.__k&&r.__k.map(function(o){return tt(o,e,t)})),r}function rt(r,e,t){return r&&t&&(r.__v=null,r.__k=r.__k&&r.__k.map(function(o){return rt(o,e,t)}),r.__c&&r.__c.__P===e&&(r.__e&&t.appendChild(r.__e),r.__c.__e=!0,r.__c.__P=t)),r}function fe(){this.__u=0,this.t=null,this.__b=null}function ot(r){var e=r.__.__c;return e&&e.__a&&e.__a(r)}function ee(){this.u=null,this.o=null}d.unmount=function(r){var e=r.__c;e&&e.__R&&e.__R(),e&&32&r.__u&&(r.type=null),et&&et(r)},(fe.prototype=new S).__c=function(r,e){var t=e.__c,o=this;o.t==null&&(o.t=[]),o.t.push(t);var n=ot(o.__v),i=!1,a=function(){i||(i=!0,t.__R=null,n?n(c):c())};t.__R=a;var c=function(){if(!--o.__u){if(o.state.__a){var p=o.state.__a;o.__v.__k[0]=rt(p,p.__c.__P,p.__c.__O)}var l;for(o.setState({__a:o.__b=null});l=o.t.pop();)l.forceUpdate()}};o.__u++||32&e.__u||o.setState({__a:o.__b=o.__v.__k[0]}),r.then(a,a)},fe.prototype.componentWillUnmount=function(){this.t=[]},fe.prototype.render=function(r,e){if(this.__b){if(this.__v.__k){var t=document.createElement("div"),o=this.__v.__k[0].__c;this.__v.__k[0]=tt(this.__b,t,o.__O=o.__P)}this.__b=null}var n=e.__a&&L(O,null,r.fallback);return n&&(n.__u&=-33),[L(O,null,e.__a?null:r.children),n]};var nt=function(r,e,t){if(++t[1]===t[0]&&r.o.delete(e),r.props.revealOrder&&(r.props.revealOrder[0]!=="t"||!r.o.size))for(t=r.u;t;){for(;t.length>3;)t.pop()();if(t[1]s("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.299616 1.99936C2.10458 1.97487 3.74912 1.28621 4.99995 0.166687C6.25078 1.28621 7.89533 1.97487 9.70029 1.99936C9.76583 2.38982 9.79995 2.79094 9.79995 3.20003C9.79995 6.33494 7.79641 9.00191 4.99995 9.99032C2.20349 9.00191 0.199951 6.33494 0.199951 3.20003C0.199951 2.79094 0.234069 2.38982 0.299616 1.99936ZM7.22422 4.22428C7.45853 3.98996 7.45853 3.61006 7.22422 3.37575C6.9899 3.14143 6.61 3.14143 6.37569 3.37575L4.39995 5.35148L3.62422 4.57575C3.3899 4.34143 3.01 4.34143 2.77569 4.57575C2.54137 4.81006 2.54137 5.18996 2.77569 5.42428L3.97569 6.62428C4.21 6.85859 4.5899 6.85859 4.82422 6.62428L7.22422 4.22428Z",fill:"#08875D"})}),Jt=$t(()=>s("div",{className:"pill __op-border __op-border-neutral-300 __op-rounded-full __op-text-success-700 __op-border-solid",children:[s(Yt,{}),"Free"]}));function Kt({onClose:r,ecocart:e=!1,customClaimUrl:t=""}){const o=document.createElement("div");o.id="op-modal-root",o.style.fontSize="16px !important",document.body.appendChild(o),X(L(At,{ecocart:e,customClaimUrl:t,onClose:r}),o)}function Zt({widget:r}){var g,u,b,I;const[e,t]=de(r),[o,n]=de(!1),[i,a]=de({enabled:e.enabled,ecocart:e.ecocart,price:e.price,minimal:e.minimal});function c(f){t(f),a({enabled:f.enabled,ecocart:f.ecocart,price:f.price,minimal:f.minimal})}function p(){if(window.orderProtectionModalHandler&&typeof window.orderProtectionModalHandler=="function")return window.orderProtectionModalHandler();Kt({onClose:()=>n(!1),ecocart:i.ecocart,customClaimUrl:r.settings.text.CUSTOM_CLAIM_URL||""})}ue(()=>{if(o)p();else{const f=document.getElementById("op-modal-root");f&&f.remove()}},[o]),ue(()=>(e.on("change",c),()=>{e.off("change",c)}),[e]);const l=f=>{f.preventDefault(),f.stopPropagation(),n(!0)},h={img:Q("",{default:"__op-w-[167px]",mobile:"__op-w-[194px]",tablet:"__op-w-[223px]"},e.elementID),button:Q("__op-flex __op-border-none __op-bg-transparent __op-outline-none __op-cursor-pointer __op-pl-[4px] mobilelg:__op-pl-[6px] tablet:__op-pl-[6px]",{default:"",mobile:"",tablet:""},e.elementID),toggle:Q("__op-flex __op-items-center __op-flex-auto __op-w-full __op-justify-end",{default:"",mobile:"",tablet:""},e.elementID),info:Q("__op-mt-0 __op-text-[10.5px] __op-font-normal __op-leading-[16px] __op-tracking-[-0.01em] __op-text-left __op-text-[#1D2433B2]",{default:"",mobile:r.settings.text.LOGO_TEXT?"":"__op-ml-[20px]",tablet:r.settings.text.LOGO_TEXT?"__op-text-[11px]":"__op-ml-[23px] __op-text-[11px]"},e.elementID)},_=(g=e.styles)==null?void 0:g.bordered;return s("div",{id:"__op__",className:U("__op-flex __op-justify-between __op-items-start __op-py-[12px] __op-w-full",_?"__op-border-solid __op-rounded __op-px-2":void 0),style:{...(u=e.styles)!=null&&u.bordered?{borderColor:e.styles.brand700,borderWidth:"2px",borderStyle:"solid",padding:"0px 16px",borderRadius:"4px"}:{},...((b=e.styles)==null?void 0:b.wrapper)||{}},"aria-hidden":o&&!window.orderProtectionModalHandler,inert:o&&!window.orderProtectionModalHandler,children:s("div",{className:"__op-w-full",children:[s("div",{className:"__op-flex dark:__op-invert __op-items-center",children:[i.minimal?s("div",{children:[s("div",{className:"__op-text-[14px] __op-whitespace-nowrap __op-mb-[-4px]",children:r.settings.text.INFORMATION_TEXT}),s("div",{className:"__op-flex __op-items-center __op-gap-2",children:[s("div",{className:"__op-text-[10px] __op-whitespace-nowrap",children:"Provided by"}),s("img",{style:{width:"150px",marginRight:"-10px",minWidth:"unset",maxWidth:"unset",maxHeight:"unset"},alt:"Order Protection Logo",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/order-protection-logo.svg"}),s("div",{onClick:l,className:h.button,style:{cursor:"pointer"},id:"opInfoModalButton",children:s("img",{onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&n(!0)},alt:"Information Modal Icon",style:"min-width: unset; max-width: unset; max-height: unset;",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/info-icon.svg",className:"__op-w-[12px] __op-h-[12px] tablet:__op-w-[16px] tablet:__op-h-[16px] __op-max-w-none",role:"button",name:"Order Protection Information Modal","aria-label":"Order Protection Information Modal","aria-haspopup":"dialog",tabIndex:0})})]})]}):s(O,{children:[r.settings.text.LOGO_TEXT?s("div",{class:"__op-text-[14px] __op-whitespace-nowrap __op-font-medium",children:r.settings.text.LOGO_TEXT}):s("img",{className:h.img,alt:"Order Protection Logo",style:"min-width: unset; max-width: unset; max-height: unset;",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/order-protection-logo.svg"}),s("div",{onClick:l,className:h.button,style:{cursor:"pointer"},id:"opInfoModalButton",children:s("img",{onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&n(!0)},alt:"Information Modal Icon",style:"min-width: unset; max-width: unset; max-height: unset;",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/info-icon.svg",className:"__op-w-[12px] __op-h-[12px] tablet:__op-w-[16px] tablet:__op-h-[16px] __op-max-w-none",role:"button",name:"Order Protection Information Modal","aria-label":"Order Protection Information Modal","aria-haspopup":"dialog",tabIndex:0})})]}),s("div",{className:h.toggle,children:i.price===0?s(Jt,{}):s(O,{children:[s(Ot,{currency:r.settings.text.CURRENCY,children:i.price}),!e.mandatory&&s(Mt,{checked:i.enabled,onChange:r.toggle.bind(e)})]})})]}),s("div",{className:h.info,style:{...((I=e.styles)==null?void 0:I.opInfo)||{}},children:[!i.minimal&&r.settings.text.INFORMATION_TEXT,s("br",{}),i.ecocart&&s("span",{className:"__op-flex __op-items-center __op-gap-[4px]",children:["& Carbon Neutral Shipping from"," ",s("img",{className:"__op-w-[58px]",src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/ecocart.svg",alt:"Ecocart Logo"})]})]})]})})}const te={WIDGET:{INFORMATION_TEXT:"Protection for Damage, Loss, Theft & More!",CURRENCY:"USD",LOGO_TEXT:null,CUSTOM_CLAIM_URL:null},MODAL:{}};function ge(r,e,t=".",o){if(!be(e))return ge(r,{},t,o);const n=Object.assign({},e);for(const i in r){if(i==="__proto__"||i==="constructor")continue;const a=r[i];a!=null&&(o&&o(n,i,a,t)||(Array.isArray(a)&&Array.isArray(n[i])?n[i]=[...a,...n[i]]:be(a)&&be(n[i])?n[i]=ge(a,n[i],(t?`${t}.`:"")+i.toString(),o):n[i]=a))}return n}function be(r){if(r===null||typeof r!="object")return!1;const e=Object.getPrototypeOf(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}function Qt(r){return(...e)=>e.reduce((t,o)=>ge(t,o,"",r),{})}const ct=Qt(),F={ready:"ready",toggled:"toggled",cartchange:"cartchange",change:"change"};let ye=(ke=class extends P{constructor(t){super();m(this,"opts");m(this,"status");m(this,"orderProtectionCost");m(this,"ecocartEnabled",!1);m(this,"mandatory_op",!1);m(this,"styles");m(this,"minimal",!1);this.opts=ct(t,{text:{INFORMATION_TEXT:te.WIDGET.INFORMATION_TEXT,CURRENCY:te.WIDGET.CURRENCY,LOGO_TEXT:te.WIDGET.LOGO_TEXT,CUSTOM_CLAIM_URL:te.WIDGET.CUSTOM_CLAIM_URL},styles:ct(t.styles,{opInfo:{},wrapper:{backgroundColor:"transparent"},bordered:!1,brand700:"#5B1FD3"}),enabled:!1,elementID:"order-protection",ecocart:!1,minimal:!1}),this.orderProtectionCost=this.opts.cost,this.status=this.opts.enabled,this.ecocartEnabled=this.opts.ecocart,this.mandatory_op=t.mandatory_op,this.styles=this.opts.styles||{},this.minimal=this.opts.minimal||!1}set enabled(t){this.status=t,this.emit(F.toggled,t)}set elementID(t){this.opts.elementID=t}get elementID(){return this.opts.elementID||"order-protection"}get enabled(){return this.status}set settings(t){this.opts=t}get settings(){return this.opts}set price(t){this.orderProtectionCost=t,this.emitChange()}get price(){return this.orderProtectionCost}set ecocart(t){this.ecocartEnabled=t,this.emitChange()}get ecocart(){return this.ecocartEnabled}get mandatory(){return this.mandatory_op}enableEcocart(){this.ecocartEnabled=!0,this.emitChange()}toggle(t){this.enabled=t}emitChange(){this.emit(F.change,this)}remove(t){var n;const o=document.getElementById(this.elementID);if(o&&o.childNodes.forEach(i=>i.remove()),t!=null&&t.selector&&document.querySelectorAll(t.selector).forEach(i=>{i==null||i.remove()}),t!=null&&t.id){const i=document.getElementById(t.id);i==null||i.remove()}if((n=t==null?void 0:t.sibling)!=null&&n.id){const i=document.getElementById(t.sibling.id);i==null||i.remove()}}__createElement({id:t,styles:o}){const n=document.createElement("div");n.setAttribute("id",t);for(const i of Object.keys(o))n.style.setProperty(i,o[i]);return n}attach(t){var i;const o=this;function n(a){a&&(X(L(Zt,{widget:o}),a),o.emit(F.ready))}if(!t){const a=document.getElementById(this.opts.elementID||"order-protection");n(a)}if(t!=null&&t.selector&&document.querySelectorAll(t.selector).forEach(a=>{n(a)}),t!=null&&t.id&&n(document.getElementById(t.id)),t!=null&&t.sibling){const a={before:"beforebegin",after:"afterend"};if(!document.getElementById(t.sibling.id)){const c=this.__createElement({id:t.sibling.id,styles:t.sibling.styles||{}});(i=document.querySelector(t.sibling.selector))==null||i.insertAdjacentElement(a[t.sibling.position],c)}n(document.getElementById(t.sibling.id))}}},m(ke,"Listeners"),ke);ye.Listeners=F;const Fr="";window.createOPWidget=r=>new ye(r);class lt{static transform(e){return e.map(t=>{const o=t.isPercentage?"percentage":"flat",n={brandPayment:t.paidBy==="brand"?{insuranceCost:t.insuranceCost,type:o}:null,customerPayment:t.paidBy==="customer"?{insuranceCost:t.insuranceCost,type:o}:null};if(!n.brandPayment&&!n.customerPayment)throw new Error("Unexpected value for paidBy, legacy works only with customer and brand");return{...n,value:t.value,...t.max!==void 0&&{max:t.max},paidBy:t.paidBy}})}static isType2(e){const t=e.customerPayment&&typeof e.customerPayment.insuranceCost=="number"&&(e.customerPayment.type==="flat"||e.customerPayment.type==="percentage"),o=typeof e.value=="number",n=e.max===void 0||typeof e.max=="number",i=e.brandPayment===null;return t&&o&&n&&i}static isType1(e){const t=typeof e.value=="number",o=e.max===void 0||typeof e.max=="number",n=typeof e.insuranceCost=="number",i=typeof e.isPercentage=="boolean",a=e.paidBy==="customer"||e.paidBy==="brand";return t&&o&&n&&i&&a}static validateObjectType(e){return e.map(t=>this.isType1(t)?"type1":this.isType2(t)?"type2":"unknown")}static isLegacy(e){return this.validateObjectType(e).every(t=>t==="type1")}}class B extends Error{constructor(e,...t){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,B),E.error(e,...t)}}function pt(r,e,t){return t-r.price>=e.price-t?e:r}function er(r){return r!=null&&r>0}function tr(r,e){return"max"in e[0]&&r>=e[0].max?(console.error("Price is greater than the max value of the first range"),!1):e.some((t,o)=>{const n=o=n&&r=t.value})}function rr(r,e){if(!er(r))throw new B("Price is invalid");if(!tr(r,e))throw new B("Price is outside the valid range")}function or(r,e){return r.find((t,o,n)=>{const i=o===n.length-1&&t.max;return i?e>=t.value&&e=t.value})}function dt(r,e){const t=[...e].sort((n,i)=>i.value-n.value);rr(r,t);const o=or(t,r);if(!o)throw new B("No suitable range found for price");return o}function re(r,e,t){if(!e)return t[0];const o=e.type==="percentage"?Math.round(r*e.insuranceCost/100):e.insuranceCost,n=sr(t,o);return ar(t,n,o)}function nr(r,e,t){switch(e.paidBy){case"customer":{if(!e.customerPayment)throw new Error("Bad Dynamic price object!");return{paidBy:"customer",brandPayment:0,customerPayment:re(r,e.customerPayment,t)}}case"brand":{if(!e.brandPayment)throw new Error("Bad Dynamic price object!");return{paidBy:"brand",brandPayment:re(r,e.brandPayment,t),customerPayment:0}}case"both":{if(!e.customerPayment||!e.brandPayment)throw new Error("Bad Dynamic price object!");const o=re(r,e.brandPayment,t),n=re(r,e.customerPayment,t);return{paidBy:"both",brandPayment:o,customerPayment:n}}default:throw new Error(`Unexpected value for paidBy: ${e.paidBy}`)}}function ir(r,e,t){const o=lt.isLegacy(e)?lt.transform(e):e,n=dt(r,o),{customerPayment:i}=nr(r,n,t);return i}function sr(r,e){let t=0,o=r.length,n=0;for(;t0&&tr[e-1].price?pt(r[e-1],r[e],t):er[e].price&&tt.vendor==="Order Protection")}originalPrice(e){e.logger.debug("from original price current widget",e);const t=this.orderProtectionItem(e.cart);return t?(e.cart.subtotal-t.final_price)/this.exchangeRate:e.cart.subtotal/this.exchangeRate}nonOPItems(e){return e.items.filter(t=>t.vendor!=="Order Protection")}async fetchExchangeRate(e){const{data:t}=await this.api.get("/exchange-rate",{params:{currency:e}});return t.rate}async fetchInsuranceInformation(){var t;const{data:e}=await this.api.get("/insurance",{params:{store_url:this.storeURL}});this.configuration=e,this.configuration.variants=(t=this.configuration.variants)==null?void 0:t.flat()}async handleSettingsResponse(e){var n,i,a,c,p,l,h,_,g,u;const t=ir(this.originalPrice(e),this.configuration.settings.dynamic_price_range,this.configuration.variants);this.variantID=t.id,this.variantPrice=t.price,e.currentVariantID=this.variantID,e.currentProductID=t.product_id,e.price=this.variantPrice;const o=e.userInfo;e.logger.debug("current variant id",this.variantID),e.logger.debug("current product id",t.product_id),e.cart.isSubscriptionCart||(typeof o.disabled>"u"?(e.logger.debug("User has no preference set"),e.widget.status=(i=(n=this.configuration)==null?void 0:n.settings)==null?void 0:i.default_op):(e.logger.debug("User has preference set",o.disabled),e.widget.status=!o.disabled)),e.ecocart=(c=(a=this.configuration)==null?void 0:a.settings)==null?void 0:c.enable_ecocart,e.opt_out_modal=(l=(p=this.configuration)==null?void 0:p.settings)==null?void 0:l.opt_out_modal,e.mandatory_op=(_=(h=this.configuration)==null?void 0:h.settings)==null?void 0:_.mandatory_op,e.splitTestSettings=(u=(g=this.configuration)==null?void 0:g.settings)==null?void 0:u.splitTestSettings,e.shouldAttach=e.cart.isSubscriptionCart?!0:this.nonOPItems(e.cart).length>0,e.widget.opts.enabled=!0}async beforeInit(e){var t,o;try{e.logger.debug("Fetching insurance information",e),await this.fetchInsuranceInformation(),e.cart.currency&&e.cart.currency!=="USD"&&(this.exchangeRate=await this.fetchExchangeRate(e.cart.currency)),e.logger.debug("Original price",this.originalPrice(e));const n=dt(this.originalPrice(e),this.configuration.settings.dynamic_price_range);if(e.logger.debug("Current range",n),n.paidBy==="brand"){e.price=0,e.ecocart=(o=(t=this.configuration)==null?void 0:t.settings)==null?void 0:o.enable_ecocart;return}await this.handleSettingsResponse(e)}catch(n){e.shouldAttach=!1,e.logger.debug("Error in dynamic pricing plugin",n)}}}class _r{constructor(){m(this,"events",{});this.events={}}isLoading(e){return this.events[e]}start(e){this.events[e]=!0}stop(e){this.events[e]=!1}}function cr(r){function e(t,...o){return[`[${t.toUpperCase()} ${r}]`,...o]}return{__debug:!1,stringify:!1,set enabled(t){this.__debug=t},get enabled(){return this.__debug},print(t,...o){this.__debug&&(this.stringify&&(o=o.map(n=>JSON.stringify(n,null,2))),console[t](...e(t,...o)))},warn(...t){this.print("warn",...t)},info(...t){this.print("info",...t)},error(...t){this.print("error",...t)},debug(...t){this.print("debug",...t)}}}const ut=cr("WRAPPER");class xe{constructor(e="https://track.internal.orderprotection.com"){m(this,"api");this.api=N({baseURL:e})}async fireEventForV2(e,t){var o,n,i,a;try{await this.api.post("/event",{testId:(o=t==null?void 0:t.splitTestSettings)==null?void 0:o.id,type:e,sessionId:(n=t==null?void 0:t.splitTestSettings)==null?void 0:n.token,metadata:{settingsType:(i=t==null?void 0:t.splitTestSettings)==null?void 0:i.type,isOriginal:(a=t==null?void 0:t.splitTestSettings)==null?void 0:a.isOriginal}})}catch{}}async fireEvent(e,t){var o,n,i,a;try{await this.api.get("/event",{params:{name:e,key:t==null?void 0:t.key,sessionID:(o=t==null?void 0:t.splitTestSettings)==null?void 0:o.token,settingsType:(n=t==null?void 0:t.splitTestSettings)==null?void 0:n.type}}),sessionStorage.setItem("__op:splitTestSettings",JSON.stringify({type:(i=t==null?void 0:t.splitTestSettings)==null?void 0:i.token,token:(a=t==null?void 0:t.splitTestSettings)==null?void 0:a.type}))}catch{await new xe("https://api.production.orderprotection.com/v1/tests").fireEventForV2(e,t)}}}function lr(r,e){return r.reduce((t,o)=>(t[o]=e,t),{})}function pr(r){return{listeners:lr(r,[]),on(e,t){this.listeners[e].push(t)},off(e,t){this.listeners[e]=this.listeners[e].filter(o=>o!==t)},$emit(e){this.listeners[e].forEach(t=>{t()})}}}function dr(r){function e(t){return{name:t,__timer:null,start(o,n){this.__timer=setInterval(o,n)},stop(){clearInterval(this.__timer),this.__timer=null}}}return{timers:r.reduce((t,o)=>(t[o]=e(o),t),{})}}function we(r){return!r||r.isSameNode(document.body)?null:r.id?r:r.parentElement?we(r.parentElement):null}function ur({id:r,selector:e,sibling:t}){function o(){return t?document.getElementById(t.id)||document.querySelector(t.selector):r?document.getElementById(r):document.querySelector(e)}const n={...pr(["removed","added"]),...dr(["child","parent"]),cachedParentID:null,wait(){this.timers.child.start(()=>{const i=o();i&&(this.timers.child.stop(),t&&(document.getElementById(t.id)||this.$emit("added")),i&&i.childNodes.length===0&&this.$emit("added"),this.init())},1e3)},get parentElement(){var i,a;return this.cachedParentID||(this.cachedParentID=(i=we(o()))==null?void 0:i.id),we((a=o())==null?void 0:a.parentElement)||document.getElementById(this.cachedParentID)},init(){this.observer||(this.observer=new MutationObserver(this.callback.bind(this)),this.observer.observe(this.parentElement,{childList:!0,subtree:!0}),this.timers.parent.start(()=>{const i=o();i&&(this.parentElement&&i.childNodes.length>0||(this.timers.parent.stop(),this.wait()))},1e3))},callback(i,a){for(const c of i)c.type==="childList"&&c.removedNodes.length>0&&c.removedNodes.length>0&&(a.disconnect(),this.observer=null,this.wait())},observer:null,timer:null};return n.wait(),n}const Br="";function hr(){const r=[{title:"Have a shipping issue? Let us know.",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_2.png",checkList:["Theft","Lost packages","Damaged items","Wrong items","Missing items","Returned to sender"]},{title:"Get a reshipment or refund within the hour.*",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_3.png"}],e=U("__op-flex __op-items-center __op-justify-start __op-mb-[16px] __op-text-[12px] __op-leading-[16px]",'before:__op-border-neutral-300 before:__op-content-[""] before:__op-border-l-[1px] before:__op-absolute');return s("div",{className:"__op-relative",children:[s("div",{className:"__op-absolute __op-top-[30px] __op-bottom-[30px] __op-bg-neutral-300 __op-w-[1px] md:__op-left-[24px] __op-left-[20px] __op-flex"}),r.map((t,o)=>s("div",{className:e,children:[s("div",{className:o===0?"__op-bg-white __op-z-[2] __op-mb-[60px] md:__op-mb-[50px]":"__op-bg-white __op-z-[2]",children:s("img",{src:t.image,alt:"Stock Image",className:"__op-h-[40px] __op-w-[40px] tablet:__op-h-[48px] tablet:__op-w-[48px] __op-rounded-full __op-border-[2px] __op-box-border __op-border-white __op-border-solid __op-shadow-op __op-mr-[16px]"})}),s("div",{children:[s("div",{className:"__op-text-[13px] md:__op-text-[14px] __op-leading-[24px] __op-tracking-[-0.005em] __op-text-[#1D2433]",style:{fontFamily:"'Inter', sans-serif"},children:t.title}),s("div",{className:"__op-leading-[24px]",style:{fontFamily:"'Inter', sans-serif"},children:t.checkList&&s("ul",{className:"__op-list __op-grid __op-grid-cols-2 __op-pl-0 __op-mt-[8px] __op-mb-0",children:t.checkList.map((i,a)=>s("li",{children:i},`${i}${a}`))})})]})]},o))]})}function mr(){const r=new Date().getUTCFullYear(),e=[{text:"Terms",link:"https://orderprotection.com/terms"},{text:"Privacy policy",link:"https://orderprotection.com/privacy-policy"},{text:"File a claim",link:"https://claims.orderprotection.com"}];return s("div",{className:"__op-text-[10px] __op-text-neutral-400 md:__op-mt-[20px] __op-mt-[15px] __op-gap-[10px] __op-flex __op-flex-col __op-text-center __op-items-center",style:{fontFamily:"'Inter', sans-serif"},children:[s("div",{className:"__op-flex __op-gap-[10px] md:__op-mb-[12px] __op-items-center",children:[s("div",{children:"Powered by:"}),s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/order-protection-logo.svg",className:"__op-h-[12px] md:__op-h-[14px]",alt:"Order Protection Logo"})]}),s("p",{class:"__op-my-0",children:"* Approved claims only, 97% approval rate."}),s("div",{className:"__op-flex __op-items-center __op-gap-[10px]",children:[r," © OrderProtection.com"," "]}),s("div",{class:"__op-flex __op-items-center __op-gap-[10px]",children:e.map(({link:t,text:o},n)=>s("a",{href:t,target:"_blank",className:"__op-text-primary-700 __op-font-normal hover:__op-underline",children:o},n))})]})}const zr="";function fr({onClose:r,store_logo:e}){return s("div",{className:"__op-fixed __op-inset-0 __op-flex __op-items-center __op-justify-center __op-bg-[#00000080] __op-z-[50000]",children:s("div",{className:"__op-absolute __op-inset-0 tablet:__op-inset-auto tablet:__op-left-0 tablet:__op-right-0 tablet:__op-h-auto __op-bg-white __op-max-w-full tablet:__op-rounded-[8px] tablet:__op-max-w-[520px] tablet:__op-box-border tablet:__op-my-[40px] __op-my-[24px] __op-mx-[12px] __op-rounded-lg __op-p-[15px] md:__op-mx-auto md:__op-pt-[40px] __op-pt-[20px] __op-pb-[40px] tablet:__op-p-[40px] __op-z-50",style:{background:`radial-gradient( 70.61% 96.11% at 36.67% -1.11%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100% ) #ffffff; `,backgroundRepeat:"no-repeat",backgroundPosition:"top right",backgroundImage:"url(https://op-media-asset.s3.us-west-1.amazonaws.com/assets/bg-svg.svg)"},children:[s("div",{className:"__op-flex __op-justify-between __op-items-center md:__op-mb-[24px] __op-mb-[15px]",children:[e?s("img",{src:e,className:"__op-h-[18px] md:__op-h-[20px]",alt:"Store Logo"}):s("span",{}),s("button",{tabIndex:0,onClick:()=>r("removeInsurance"),class:"__op-border __op-border-solid __op-rounded-full __op-h-[30px] __op-w-[30px] __op-bg-transparent __op-outline-none __op-cursor-pointer __op-flex __op-items-center __op-justify-center __op-p-0",children:[s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/close-icon.svg",alt:"Close Info Modal"}),s("span",{className:"__op-sr-only",children:"Close Info Modal"})]})]}),s("div",{className:"md:__op-mb-[16px] __op-mb-[10px]",children:s("h2",{className:"__op-text-[30px] tablet:__op-text-[36px] __op-tracking-tight md:__op-mb-[20px] __op-border-b-[1px] __op-border-neutral-300 __op-text-typography-primary",style:{fontFamily:"'Faktum', sans-serif"},children:"Are you sure you don't want to protect your order?"})}),s("div",{className:"__op-bg-neutral-300 __op-w-full __op-h-[1px] __op-flex"}),s("div",{className:"__op-relative",children:[s("div",{className:"__op-text-typography-primary md:__op-text-[18px] __op-leading-[24px] __op-font-semibold md:__op-my-[20px] __op-my-[15px]",style:{fontFamily:"'Inter', sans-serif"},children:"You'll be covered for all major shipping issues Here's how it works:"}),s(hr,{}),s("div",{className:"__op-w-full __op-flex __op-flex-col __op-items-center __op-text-center __op-justify-center __op-gap-[18px]",children:[s("a",{className:"__op-bg-primary-700 __op-text-white __op-rounded-md __op-w-full __op-py-[12px] __op-text-[16px] __op-leading-[24px] __op-cursor-pointer __op-no-underline hover:__op-bg-primary-800",onClick:()=>r("keepInsurance"),style:{fontFamily:"'Inter', sans-serif"},children:"Keep Order Protection"}),s("button",{className:"__op-bg-white __op-border-none __op-w-full __op-text-danger-800 __op-underline __op-cursor-pointer __op-text-[13px]",onClick:()=>r("removeInsurance"),style:{fontFamily:"'Inter', sans-serif"},children:"No, I don't want to protect my order"})]})]}),s("div",{className:"__op-bg-neutral-300 __op-w-full __op-h-[1px] md:__op-mt-[20px] __op-mt-[15px] __op-flex"}),s(mr,{})]})})}function gr({store_logo:r,onClose:e}){if(!document.getElementById("order-protection-opt-out-modal")){const t=document.createElement("div");return t.id="order-protection-opt-out-modal",document.body.appendChild(t),new Promise(o=>{function n(i){e(i),o(i),document.body.removeChild(t)}return X(L(fr,{onClose:n,store_logo:r}),t)})}}function br(r){return!!r.prototype&&!!r.prototype}const yr="Order Protection",C=class C{constructor({enabled:e=!0,attach:t=!0,ecocart:o=!1,styles:n,text:i,product_variant_id:a=0,product_id:c=0,plugins:p=[],store_url:l="",debug:h=!1,minimal:_=!1,locations:g=[],dynamicSettings:u=!0,Cart:b}){m(this,"shouldAttach",!0);m(this,"widget");m(this,"opt_out_modal",!1);m(this,"mandatory_op",!1);m(this,"splitTestSettings",null);m(this,"currentVariantID");m(this,"currentProductID");m(this,"cart");m(this,"plugins",[]);m(this,"loader");m(this,"elementIds");m(this,"settings",{});m(this,"storeUrl");m(this,"itemMetadata",{});m(this,"initialized",!1);m(this,"logger",ut);m(this,"tracker");m(this,"observers",[]);br(b)?this.cart=new b:this.cart=b,this.loader=new _r,this.currentVariantID=a,this.currentProductID=c,this.shouldAttach=t,this.storeUrl=l,this.opt_out_modal=!1,this.plugins=p,!(this.plugins&&this.plugins.length&&this.plugins.some(f=>f instanceof ve))&&u&&this.plugins.push(new ve(l)),this.widget=new ye({enabled:e,ecocart:o,styles:n,text:i,minimal:_,mandatory_op:this.mandatory_op}),this.elementIds=[{id:"order-protection"},...g],this.itemMetadata={},this.settings={text:i,styles:n},this.logger=ut,this.logger.enabled=["development","test"].includes("production")||h,this.tracker=new xe}static resetInstance(){sessionStorage.removeItem("__op:userInfo"),C.instance=null}static hasBeenInitialized(){return!!C.instance}static getInstance(e){if(!C.instance&&!e)throw new Error("Widget must be initialized with options");return C.instance||(C.instance=new C(e)),typeof window<"u"&&(window.orderProtection=C.instance),C.instance}addRenderLocation(e){return this.elementIds.push(e),this}addPlugin(e){this.plugins.push(e)}async firePluginEvent(e){var o;let t=0;for(;t{const o={...e,sibling:e.sibling?{...e.sibling,id:`order-protection-${t}`}:void 0};this.widget.remove(o)});return}this.widget.mandatory_op=this.mandatory_op,this.elementIds.forEach((e,t)=>{const o={...e,sibling:e.sibling?{...e.sibling,id:`order-protection-${t}`}:void 0};if(this.logger.debug("Attaching to location:",e),this.widget.attach(o),!this.initialized){this.logger.debug("Creating enhanced watcher",o);const n=ur(o);n.on("added",()=>{this.logger.debug("Enhanced watcher added",this.initialized?"will attach":"will init"),this.initialized?this.attach():this.init()}),this.logger.debug("Adding observer to list, current size: ",this.observers.length),this.observers.push(n),this.logger.debug("Observer added, current size: ",this.observers.length)}}),await this.firePluginEvent("afterAttach")}get shouldRefresh(){var e;return this.cart.items.length>0&&!((e=this.userInfo)!=null&&e.disabled)&&!this.orderProtectionItem}removeAllFormInputs(){this.cart.items.filter(this.itemIsOrderProtection).forEach(e=>{this.deleteFormValue(e.variant_id)})}async firstAdd(){var e;(e=this.userInfo)!=null&&e.disabled?(this.logger.debug("User has disabled Order Protection"),this.toggle(!1)):(this.logger.debug({enabled:this.enabled,orderProtectionIsInCart:this.orderProtectionIsInCart}),this.widget.status=this.enabled||this.orderProtectionIsInCart),this.enabled&&(this.logger.debug("Order Protection is enabled, adding to cart..."),await this.addInsurance())}async init(){await this.cart.load(),await this.firePluginEvent("beforeInit"),this.logger.debug("Initializing..."),this.removeAllFormInputs(),this.addWidgetHooks(),this.nonOPItems().length<1?await this.removeInsurance():await this.firstAdd();try{await this.attach(),this.initialized=!0}catch(e){return this.logger.error("Error initializing widget",e),console.error(e)}finally{await this.firePluginEvent("afterInit"),this.splitTestSettings&&this.shouldAttach&&await this.tracker.fireEvent("widget:rendered",{key:this.storeUrl,splitTestSettings:this.splitTestSettings})}}itemIsOrderProtection(e){return e.vendor===yr}async addInsurance(){var e,t,o;if(!this.cart.isSubscriptionCart){if(this.loader.isLoading("addInsurance")){this.logger.debug("Already adding insurance, skipping...");return}if(await this.firePluginEvent("beforeAddToCart"),this.orderProtectionIsInCart&&((e=this.orderProtectionItem)==null?void 0:e.variant_id)!==this.currentVariantID&&(this.logger.debug("VARIANTS DO NOT MATCH",{isInCart:this.orderProtectionIsInCart,variantID:this.currentVariantID,orderProtectionItemVariantID:(t=this.orderProtectionItem)==null?void 0:t.variant_id}),this.logger.debug(this.orderProtectionItem),this.logger.debug("Calling remove insurance before adding new sku"),await this.removeInsurance()),!this.orderProtectionCanBeAdded){this.logger.debug("Cannot add insurance, skipping..."),this.logger.debug("This can mean that there are no physical goods in the cart, price is above the max, or price is $0"),this.logger.debug({requiresShipping:this.cart.requires_shipping,items:this.cart.items,canBeAdded:this.orderProtectionCanBeAdded,orderProtectionItem:this.orderProtectionItem,currentVariantID:this.currentVariantID,total_price:this.cart.subtotal,shouldAttach:this.shouldAttach}),await this.removeInsurance();return}if(this.orderProtectionItem&&this.orderProtectionItem.variant_id===this.currentVariantID||this.currentVariantID===0){this.logger.debug("Cannot add insurance, skipping..."),this.logger.debug("This can mean that the correct variant is already in the cart, or the variant ID is not set"),this.logger.debug({variantIdsAreSame:((o=this.orderProtectionItem)==null?void 0:o.variant_id)===this.currentVariantID,items:this.cart.items,orderProtectionItem:this.orderProtectionItem,currentVariantID:this.currentVariantID});return}this.loader.start("addInsurance"),this.logger.debug("Adding insurance to cart...");try{await this.cart.add({variantId:this.currentVariantID,productId:this.currentProductID}),this.widget.status=!0,await this.cart.load(),await this.firePluginEvent("afterAddToCart");const n=new Event("OP:updated:cart");document.dispatchEvent(n)}catch(n){return this.logger.debug("Error adding insurance to cart",n),console.error(n)}finally{this.loader.stop("addInsurance")}}}nonOPItems(){return this.cart.items.filter(e=>!this.itemIsOrderProtection(e))}async removeInsurance(){if(this.cart.isSubscriptionCart||(this.loader.start("removeInsurance"),await this.firePluginEvent("beforeRemoveFromCart"),this.removeAllFormInputs(),!this.orderProtectionIsInCart))return;await this.cart.remove({variantId:this.currentVariantID,productId:this.currentProductID}),await this.cart.load(),await this.firePluginEvent("afterRemoveFromCart");const e=new Event("OP:updated:cart");document.dispatchEvent(e)}async handleToggleEvent(e){const t=i=>new Promise(a=>{gr({store_logo:i,onClose:c=>{a(c)}})});let o=!0;if(!e&&!sessionStorage.getItem("__op:userInfo")&&this.opt_out_modal){o=!1;const i=await N({baseURL:"https://back.orderprotection.com"}).get(`/store-settings/${this.storeUrl}`);await t(i==null?void 0:i.data.logo)==="removeInsurance"?o=!0:this.widget.enabled=!0}if(!o)return;this.saveUserDecision(e),(e?this.addInsurance:this.removeInsurance).bind(this)(),this.widget.emitChange(),this.firePluginEvent("reload")}addWidgetHooks(){var e,t;this.widget.on(F.toggled,this.handleToggleEvent.bind(this)),(t=(e=this.cart).on)==null||t.call(e,"change",this.handleCartChange.bind(this))}handleCartChange(e){const t=e.items.findIndex(this.itemIsOrderProtection)>-1;this.widget.status=t}async refresh(){var e;this.loader.isLoading("refresh")||(this.loader.start("refresh"),await this.cart.load(),this.widget.enabled=this.orderProtectionIsInCart,this.widget.price=((e=this.orderProtectionItem)==null?void 0:e.final_price)||this.widget.price,this.attach(),this.loader.stop("refresh"))}remove(){this.widget.remove()}async swapOrderProtectionSkus(){await this.removeInsurance(),await this.addInsurance()}get price(){return this.widget.price}get enabled(){return this.widget.enabled}get orderProtectionItem(){var e;return(e=this.cart)!=null&&e.orderProtectionItem?this.cart.orderProtectionItem:this.cart.items.find(this.itemIsOrderProtection)}get orderProtectionIsInCart(){var e;return(e=this.cart)!=null&&e.orderProtectionIsInCart?this.cart.orderProtectionIsInCart:this.cart.items.findIndex(this.itemIsOrderProtection)>-1}get shouldAddOPOnLoad(){var e;return this.nonOPItems().length===0||this.orderProtectionIsInCart||(e=this.userInfo)!=null&&e.disabled?!1:this.widget.enabled}get userInfo(){if(this.cart.isSubscriptionCart)return;const e={loaded:!1};try{return JSON.parse(sessionStorage.getItem("__op:userInfo"))||e}catch{return e}}get orderProtectionCanBeAdded(){var t;if((t=this.cart)!=null&&t.orderProtectionCanBeAdded)return this.cart.orderProtectionCanBeAdded;const e=this.cart.subtotal||0;return this.logger.debug({nonOPItems:this.nonOPItems(),totalPrice:e,requiresShipping:this.cart.requires_shipping}),this.cart.requires_shipping&&this.shouldAttach&&this.nonOPItems().length>0&&e>0}set userInfo(e){this.cart.isSubscriptionCart||sessionStorage.setItem("__op:userInfo",JSON.stringify(e))}set ecocart(e){this.widget.ecocart=e}set price(e){this.widget.price=e}set enabled(e){this.widget.enabled=e}saveUserDecision(e){this.userInfo={...this.userInfo,disabled:!e}}deleteFormValue(e){const t=document.querySelector(`[name="updates[${e}]"]`);if(t){t.remove();return}const o=Array.from(document.querySelectorAll("[name*=updates]")).find(n=>n.getAttribute("data-product-id")===e.toString());o&&o.remove()}set variantID(e){var t;this.currentVariantID=e,this.removeAllFormInputs(),this.orderProtectionIsInCart&&((t=this.orderProtectionItem)==null?void 0:t.variant_id)!==e&&this.widget.emitChange()}set currentItemMetadata(e){this.itemMetadata=e}set debug(e){this.logger.enabled=e}};m(C,"instance",null);let Ie=C;class vr{constructor({optIn:e,storeURL:t}){m(this,"settings");m(this,"api");m(this,"storage");this.settings={storeURL:t,optIn:e,apiDomain:"https://track.internal.orderprotection.com"},this.api=N({baseURL:this.settings.apiDomain,withCredentials:!0}),this.storage=sessionStorage}trackEvent(e,t){const{sessionID:o,on:n,type:i}=this.userSettings;return this.api.get("/event",{params:{name:e,key:this.settings.storeURL,sessionID:o,on:n,type:i,...t}})}fiftyFifty(){return Math.round(Math.random()*1)===0}async beforeInit(e){if(!this.settings.storeURL||!await this.hasActiveTest())return;const{on:o,type:n}=this.userSettings;n==="hide-show"?e.shouldAttach=o:n==="opt-in"&&(e.shouldAttach=!0,e.enabled=o),this.trackEvent(`${n}::widget:${o?"enabled":"disabled"}`,{attached:e.shouldAttach})}get userSettings(){return this.storage.getItem("__OP:AB:Settings")||this.storage.setItem("__OP:AB:Settings",JSON.stringify({sessionID:Math.random().toString(36).substring(2),on:this.fiftyFifty(),type:this.settings.optIn?"opt-in":"hide-show"})),JSON.parse(this.storage.getItem("__OP:AB:Settings"))}async hasActiveTest(){if(!this.settings.storeURL)return!1;try{const{data:e}=await this.api.get("/active",{params:{key:this.settings.storeURL}});return e.active}catch{return!1}}}function xr({element:r,callback:e}){if(!r){console.warn("element does not exist");return}const t=new MutationObserver(e);return t.observe(r,{childList:!0,subtree:!0}),t}class wr{constructor(e){m(this,"conditions");this.conditions=e}get isBrowser(){return typeof window<"u"}get shouldReload(){let e=!1;if(this.isBrowser){for(let t=0;t{let[o,n]=t;if(o.endsWith("add.js")||o.endsWith("change.js")){const i=await e(o,n);return await r.init(),i}else return await e(o,n)}}}}const ht=Object.freeze(Object.defineProperty({__proto__:null,ReloadOnToggle:wr,SettingsPlugin:ve,SplitTestingPlugin:vr,WatchChangesPlugin:xr,overrideFetchPlugin:Ir},Symbol.toStringTag,{value:"Module"})),Hr="";function Pr(){const r=[{title:"Have a shipping issue? Let us know.",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_2.png",checkList:["Theft","Lost packages","Damaged items","Wrong items","Missing items","Returned to sender"]},{title:"Get a reshipment or refund within the hour.*",image:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/widget-v2/avartar_3.png"}],e=U("__op-flex __op-items-center __op-justify-start __op-mb-[16px] __op-text-[12px] __op-leading-[16px]",'before:__op-border-neutral-300 before:__op-content-[""] before:__op-border-l-[1px] before:__op-absolute');return s("div",{className:"__op-relative",children:[s("div",{className:"__op-absolute __op-top-[30px] __op-bottom-[30px] __op-bg-neutral-300 __op-w-[1px] md:__op-left-[24px] __op-left-[20px] op-h-[50px]"}),r.map((t,o)=>s("div",{className:e,children:[s("div",{className:o===0?"__op-bg-white __op-z-[2] __op-mb-[60px] md:__op-mb-[50px]":"__op-bg-white __op-z-[2]",children:s("img",{src:t.image,alt:"Stock Image",className:"__op-h-[40px] __op-w-[40px] tablet:__op-h-[48px] tablet:__op-w-[48px] __op-rounded-full __op-border-[2px] __op-box-border __op-border-white __op-border-solid __op-shadow-op __op-mr-[16px]"})}),s("div",{children:[s("div",{className:"__op-text-[13px] md:__op-text-[14px] __op-leading-[24px] __op-tracking-[-0.005em] __op-text-[#1D2433]",children:t.title}),s("div",{className:"__op-leading-[24px]",children:t.checkList&&s("ul",{className:"__op-list __op-grid __op-grid-cols-2 __op-pl-0 __op-mt-[8px] __op-mb-0",children:t.checkList.map((i,a)=>s("li",{children:i},`${i}${a}`))})})]})]},o))]})}function kr(){const r=new Date().getUTCFullYear(),e=[{text:"Terms",link:"https://orderprotection.com/terms"},{text:"Privacy policy",link:"https://orderprotection.com/privacy-policy"},{text:"File a claim",link:"https://claims.orderprotection.com"}];return s("div",{className:"__op-text-[10px] __op-text-neutral-400 md:__op-mt-[20px] __op-mt-[15px] __op-gap-[10px] __op-flex __op-flex-col __op-text-center __op-items-center",children:[s("div",{className:"__op-flex __op-gap-[10px] md:__op-mb-[12px] __op-items-center",children:[s("div",{children:"Powered by:"}),s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/order-protection-logo.svg",className:"__op-h-[12px] md:__op-h-[14px]",alt:"Order Protection Logo"})]}),s("p",{class:"__op-my-0",children:"* Approved claims only, 97% approval rate."}),s("div",{className:"__op-flex __op-items-center __op-gap-[10px]",children:[r," © OrderProtection.com"," "]}),s("div",{class:"__op-flex __op-items-center __op-gap-[10px]",children:e.map(({link:t,text:o},n)=>s("a",{href:t,target:"_blank",className:"__op-text-primary-700 __op-font-normal hover:__op-underline",children:o},n))})]})}const Vr="";function Nr({onClose:r,order_id:e,store_logo:t}){return s("div",{className:"__op-fixed __op-inset-0 __op-flex __op-items-center __op-justify-center __op-bg-[#00000080] __op-z-[1000]",style:{fontFamily:"'Inter', sans-serif !important"},children:s("div",{className:"__op-absolute __op-inset-0 tablet:__op-inset-auto tablet:__op-left-0 tablet:__op-right-0 tablet:__op-h-auto __op-bg-white __op-max-w-full tablet:__op-rounded-[8px] tablet:__op-max-w-[520px] tablet:__op-box-border tablet:__op-my-[40px] __op-my-[24px] __op-mx-[12px] __op-rounded-lg __op-p-[15px] md:__op-mx-auto md:__op-pt-[40px] __op-pt-[20px] __op-pb-[40px] tablet:__op-p-[40px] __op-z-50",style:{background:`radial-gradient( 70.61% 96.11% at 36.67% -1.11%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100% ) #ffffff; `,backgroundRepeat:"no-repeat",backgroundPosition:"top right",backgroundImage:"url(https://op-media-asset.s3.us-west-1.amazonaws.com/assets/bg-svg.svg)"},children:[s("div",{className:"__op-flex __op-justify-between __op-items-center md:__op-mb-[24px] __op-mb-[15px]",children:[t?s("img",{src:t,className:"__op-h-[18px] md:__op-h-[20px]",alt:"Store Logo"}):s("span",{}),s("button",{tabIndex:0,onClick:r,class:"__op-border __op-border-solid __op-rounded-full __op-h-[30px] __op-w-[30px] __op-bg-transparent __op-outline-none __op-cursor-pointer __op-flex __op-items-center __op-justify-center __op-p-0",children:[s("img",{src:"https://op-media-asset.s3.us-west-1.amazonaws.com/assets/close-icon.svg",alt:"Close Info Modal"}),s("span",{className:"__op-sr-only",children:"Close Info Modal"})]})]}),s("div",{className:"md:__op-mb-[16px] __op-mb-[10px]",children:s("h2",{className:"__op-text-[30px] tablet:__op-text-[36px] __op-tracking-tight md:__op-mb-[20px] __op-border-b-[1px] __op-border-neutral-300 __op-text-typography-primary",style:{fontFamily:"'Faktum', sans-serif"},children:"Wait, your order isn't insured!"})}),s("div",{className:"__op-bg-neutral-300 __op-w-full __op-h-[1px]"}),s("div",{className:"__op-relative",children:[s("div",{className:"__op-text-typography-primary md:__op-text-[18px] __op-leading-[24px] __op-font-semibold md:__op-my-[20px] __op-my-[15px]",style:{fontFamily:"'Faktum', sans-serif"},children:"Add shipping insurance to your order!"}),s(Pr,{}),s("div",{className:"__op-w-full __op-flex __op-flex-col __op-items-center __op-text-center __op-justify-center __op-gap-[18px]",children:[s("a",{className:"__op-bg-primary-700 __op-text-white __op-rounded-md __op-border-none __op-w-full __op-py-[12px] __op-text-[16px] __op-leading-[24px] __op-cursor-pointer __op-no-underline",href:`https://buy.orderprotection.com/direct-pay/order/${e}`,target:"_blank",children:"Yes, Add Insurance"}),s("button",{className:"__op-bg-white __op-border-none __op-w-full __op-text-danger-800 __op-underline __op-cursor-pointer __op-text-[13px]",onClick:r,children:"No, I don't want to protect my order"})]})]}),s("div",{className:"__op-bg-neutral-300 __op-w-full __op-h-[1px] md:__op-mt-[20px] __op-mt-[15px]"}),s(kr,{})]})})}function Cr({order_id:r,store_logo:e}){const t=document.createElement("div");t.id="order-protection-post-purchase",document.body.appendChild(t);function o(){document.body.removeChild(t)}return X(L(Nr,{onClose:o,order_id:r,store_logo:e}),t)}function mt(r,e){return r.some(t=>t instanceof RegExp?t.test(e):t.includes(e))}function Er(r,e){return class extends XMLHttpRequest{constructor(){super()}handleRequest(o,n){mt(r,o)&&(n==="POST"||n==="PUT")&&(e(),this.removeEventListener("load",this.handleRequest.bind(this,o,n)))}open(o,n,i,a,c){this.addEventListener("load",this.handleRequest.bind(this,n,o)),super.open(o,n,!!i,a,c)}}}function Or(r,e){if(!(window!=null&&window.fetch))return;const t=window.fetch,o=new Proxy(t,{apply:async(n,i,a)=>{if(a[0]instanceof URL)return t.apply(i,[a[0].toString()]);const c=typeof a[0]=="object",p=c?a[0].url:a[0],l=c?a[0]:a[1],h=(l==null?void 0:l.headers)||{};if(!mt(r,p)||h["x-source"]==="orderprotection"||l.method!=="POST"&&l.method!=="PUT")return t.apply(i,a);const _=await t.apply(i,a);return window.location.host==="www.theclosetinc.com"&&!JSON.parse(l.body).updates||e(),_}});window.XMLHttpRequest=Er(r,e),window.fetch=o}function Sr(r={}){var o,n,i,a;r.Cart||(r.Cart=Ee),r.store_url||(r.store_url=(o=window.Shopify)==null?void 0:o.shop),r.proxy_fetch=r.proxy_fetch??!0,!((n=r.text)!=null&&n.CURRENCY)&&((a=(i=window.Shopify)==null?void 0:i.currency)!=null&&a.active)&&(r.text={...r.text,CURRENCY:window.Shopify.currency.active});const e=function(){window.orderProtection&&(console.log("order protection is being re-initialized"),window.orderProtection.init())},t=[/\/cart\/(change|update|add|clear)/];return r.proxy_fetch&&Or(t,e),Ie.getInstance(r)}Object.entries(ht).forEach(([r,e])=>{window[r]=e});const Tr=Ee;w.Cart=Tr,w.Plugins=ht,w.createOrderProtectionWidget=Sr,w.showPostPurchaseModal=Cr,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});